<template>
	<cl-page>
		<view class="page-wrap"> </view>
	</cl-page>
</template>

<script lang="ts" setup>
import { onLoad } from "@dcloudio/uni-app";

import { router, useStore } from "/@/cool";

const { user } = useStore();

onLoad(async (params: any) => {
	if (params?.token) {
		await user.setToken(params.token);
		
		await user.set({
			appLoginToken: params?.token,
			userId: params?.userId,
			userName: params?.userName,
		});

		await user.get();
	}

	console.info("params?.token", params?.token);
	console.info("params.path", params.path);

	if (params.path == "contract") {
		router.push({
			path: "/pages/index/contract",
			mode: "redirectTo",
			query: {
				id: params?.id,
				type: params?.type,
			},
		});
	} else {
		router.push({
			path: "/pages/index/booth",
			mode: "redirectTo",
			query: {
				pid: params?.pid,
				eid: params?.eid,
				ptime: params?.ptime,
				pname: params?.pname,
				ename: params?.ename,
				type: params?.type,
			},
		});
	}
});
</script>

<style lang="scss" scoped></style>
